<template>
  <div class="person">
    <h1>我是Person组件</h1>
    <h3>我有一台游戏机：{{toy}}</h3>
    <button @click="sendToy(toy)">游戏机玩腻了，给父亲玩吧</button>
  </div>
</template>

<script>
  export default {
    name:'Person',
    props:['sendToy'],
    data() {
      return {
        toy:'小霸王游戏机'
      }
    },
    /* methods: {
      handleClick(){
        this.sendToy(this.toy)
      }
    }, */
  }
</script>

<style scoped>
  .person {
    background-color: skyblue;
    padding: 20px;
  }
</style>